﻿namespace Auxiliary.VecMath
{
    internal static class Util
    {
        public static float Clamp(float arg, float min, float max)
        {
            return arg < min ? min : arg > max ? max : arg;
        }

        public static float Step(float arg, float edge)
        {
            return arg < edge ? 0.0f : 1.0f;
        }

        public static float SmoothStep(float arg, float left, float right)
        {
            var result = Clamp((arg - left) / (right - left), 0.0f, 1.0f);

            return result * result * (3.0f - 2.0f * result);
        }
    }
}
